 var index_arr=new Array();
    index_arr.push("&caid=2");
    index_arr.push("&caid=3");
    index_arr.push("&caid=4");
    index_arr.push("&caid=1");
    index_arr.push("&caid=11&addno=1");
    index_arr.push("&caid=14");
    index_arr.push("&caid=101");
    index_arr.push("&caid=516");
$(function(){
 
    var $_Search = $(".txt");
    var $_SearchDic = $("#SearchDic");
    var _SraIndex=1;
    
  

    $_SearchDic.find('li').live("mouseover", function () {
        $(this).addClass("hover");
    });
    $_SearchDic.find('li').live("mouseleave ", function () {
        $(this).removeClass("hover");
    });
    $_SearchDic.find('li').live("click", function () {
        $_Search.eq(_SraIndex).val($(this).children('a').text());
        $_Search.eq(_SraIndex).attr("dic", $(this).attr("id"));
        $_SearchDic.hide();
    });
    $(".jjr_quyu ul li").each(function (i) {
        $(this).mouseover(function () {
            $(this).siblings().removeClass("quyu").add("quyu");
            $("[class^='user_qu_v']").hide().eq(i).show();
        });
    });
   $_Search.each(function(i){
       
       $(this).attr("autocomplete","off");
       $(this).keyup(function(){
           if($(this).val()!=''){
           var para=index_arr[i];
           Search(para,$(this).val())
             var _left = $_Search.eq(i).offset().left;
             var _top = $_Search.eq(i).offset().top + $_Search.eq(i).height();
            $_SearchDic.css("width",$_Search.eq(i).innerWidth()+'px');
            $_SearchDic.css({"left": _left, "top": _top});
            _SraIndex=i;
           }
       })
   })
   $("#tabbar1").mouseover(function(){
       $_SearchDic.html('');
        $_SearchDic.hide();
   })
  var Search=function(_para,_Keyword){
  $.ajax({
   type: "GET",
   dataType:"html",
   url: "/tools/ajax.php",
   data: "action=IndexSearch"+_para+"&Keyword="+_Keyword,
   success: function(msg){
     if(msg!=""){    

          $_SearchDic.html(msg);
          $_SearchDic.slideDown();
     }else{
         $_SearchDic.html('');
         $_SearchDic.hide();
     }
     
   }
  });
}

})
